home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / fpkpas92.zip / SRCRTL.ZIP / RTL / DOS / WATCH.PP < prev   
Text File  |  1997-07-01  |  968b  |  46 lines

  1. unit watch;
  2.  
  3. interface
  4.  
  5. uses DOS;
  6.  
  7. function TotalTime:string;
  8. procedure StartTime;
  9. procedure EndTime;
  10.  
  11. implementation
  12.  
  13. var
  14.     h0,m0,s0,d0 : word;
  15.     h1,m1,s1,d1 : word;
  16.     h,m,s,d     : word;
  17. function TotalTime:String;
  18. var mm0,ss0,dd0:integer;
  19.     st,temp:string;
  20. begin
  21. mm0:=m0;ss0:=s0;dd0:=d0;
  22. if d1 < d0 then begin dd0:=dd0-100;inc(ss0);end;
  23. d:=word(d1-dd0) ; str(d,temp);
  24. if d<10 then st:='0'+temp else st:=temp;
  25. st:='.'+st;
  26.  
  27. if s1 < ss0 then begin ss0:=ss0-60;inc(mm0);end;
  28. s:=word(s1-ss0) ; str(s,temp);
  29. if s<10 then st:='0'+temp+st else st:=temp+st;
  30. st:=':'+st;
  31.  
  32. if m1 < mm0 then begin mm0:=mm0-60;inc(h0);end;
  33. m:=word(m1-mm0) ; str(m,temp);
  34. if m<10 then st:='0'+temp+st else st:=temp+st;
  35. st:=':'+st;
  36.  
  37. h:=word(h1-h0) ; str(h,temp);
  38. if h<10 then st:='0'+temp+st else st:=temp+st;
  39.  
  40. TotalTime:=st;
  41. end;
  42.  
  43. procedure StartTime; begin Gettime(h0,m0,s0,d0); end;
  44. procedure EndTime  ; begin Gettime(h1,m1,s1,d1); end;
  45.  
  46. end.